<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="24">
            <a-form-item label="项目编号">
              <j-input placeholder="请输入项目编号" v-model="queryParam.xmbh"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <a-form-item label="项目名称">
              <j-input placeholder="请输入项目名称" v-model="queryParam.xmmc"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="10" :sm="24">
            <a-form-item label="发布时间">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.fbsj_begin"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.fbsj_end"></j-date>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <a-form-item label="结算单号">
              <j-input placeholder="请输入项目单号" v-model="queryParam.jsdh"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <a-form-item label="企业名称">
              <j-input placeholder="请输入企业名称" v-model="queryParam.qyzhm"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <a-form-item label="项目类型">
              <j-input placeholder="请输入项目类型" v-model="queryParam.xmlx"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="3" :lg="7" :md="5" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
        </span>

      </a-table>
    </div>
    <pt-djs-modal ref="modalForm" @ok="modalFormOk"></pt-djs-modal>
  </a-card>
</template>

<script>

  import { postAction } from '@/api/manage'
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PtDjsModal from './modules/PtDjsModal'
  import JImageUpload from '@/components/jeecg/JImageUpload'
  import JDate from '@/components/jeecg/JDate.vue'
  import JInput from '@/components/jeecg/JInput'

  export default {
    name: 'PtDjsList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      PtDjsModal,
      JImageUpload,
      JDate,
      JInput
    },
    data () {
      return {
        description: '企业财务管理管理页面',
        form: this.$form.createForm(this),
        // 表头
        columns: [
          {
            title:'企业名称',
            align:"center",
            dataIndex: 'qyzhm'
          },
          {
            title:'结算单号',
            align:"center",
            dataIndex: 'jsdh'
          },
          {
              title:'项目编号',
              align:"center",
              dataIndex: 'xmbh'
          },
          {
              title:'项目协议编号',
              align:"center",
              dataIndex: 'xmxybh'
          },
          {
              title:'项目名称',
              align:"center",
              dataIndex: 'xmmc'
          },
          {
            title:'项目类型',
            align:"center",
            dataIndex: 'xmlx'
          },
          {
              title:'发布时间',
              align:"center",
              dataIndex: 'fbsj'
          },
          {
            title:'结算金额',
            align:"center",
            dataIndex: 'jsje'
          },
          {
            title:'本次纳税金额',
            align:"center",
            dataIndex: 'sigtaxje'
          },
          {
            title:'平台服务费',
            align:"center",
            dataIndex: 'fwfje'
          },
          {
            title:'总金额',
            align:"center",
            dataIndex: 'zje'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/project/lhygQyFinance/getPtDjslist",
          edit: "/project/lhygQyFinance/edit",
          delete: "/project/lhygQyFinance/delete",
          deleteBatch: "/project/lhygQyFinance/deleteBatch",
          exportXlsUrl: "/project/lhygQyFinance/exportXls",
          importExcelUrl: "project/lhygQyFinance/importExcel",
        },
        dictOptions:{},
      }
    },
    created() {
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>